<template>
  <view class="webview-container">
    <!-- web-view 组件 -->
    <web-view  @message="handleMessage" :src="webviewUrl"></web-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      webviewUrl: ''
    };
  },
  onLoad(opt) {
	const params = JSON.parse(decodeURIComponent(opt.data));
    this.webviewUrl = params.webviewUrl;
  },
  methods: {
      handleMessage(e) {
          console.log("收到消息XXXX:", e);
        }
  }
};
</script>

<style scoped>
.webview-container {
  position: relative;
  width: 100%;
  height: 100vh;
}
</style>